package org.example.back.service.plan;

import org.example.back.entity.plan.MuscleGainPlan;
import org.example.back.mapper.plan.MuscleGainPlanMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;

@Service
public class MuscleGainPlanService {

    @Autowired
    private MuscleGainPlanMapper muscleGainPlanMapper;

    public boolean addPlan(MuscleGainPlan plan) {
        return muscleGainPlanMapper.insert(plan) > 0;
    }

    public MuscleGainPlan getPlanByUserIdAndStartDate(Integer userId, LocalDate startDate) {
        return muscleGainPlanMapper.selectByUserIdAndStartDate(userId, startDate);
    }
}
